package com.fengniu.ejb.dao;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fengniu.ejb.entity.Site;
import com.fengniu.ejb.entity.Site2Category;
import com.fengniu.ejb.entity.Site2Content;
import com.fengniu.ejb.entity.Site2Site;

public interface ISiteDao extends Serializable {

	/**
	 * 
	 * @param site
	 * @return
	 */
	public Site saveSite(Site site);

	public void deleteSiteBySiteId(String siteId);

	/**
	 * 
	 * @param site2Category
	 * @return
	 */
	public Site2Category saveSite2Category(Site2Category site2Category);

	/**
	 * 
	 * @param site2Content
	 * @return
	 */
	public Site2Content saveSite2Content(Site2Content site2Content);

	/**
	 * 
	 * @param site2Site
	 * @return
	 */
	public Site2Site saveSite2Site(Site2Site site2Site);

	/**
	 * 
	 * @param site2CategorySysId
	 * @return
	 */
	public void deleteSite2Category(long site2CategorySysId);

	public void deleteSite2Content(long site2ContentSysId);

	/**
	 * 
	 * @param webSiteHomeUrl
	 * @param relationType
	 * @param id
	 * @return
	 */
	public Site2Category findSite2CategoryBy(String webSiteHomeUrl, Integer relationId, String categoryId,
			Integer statusId);

	/**
	 * 
	 * @param siteSysId
	 * @param relationType
	 * @param categorySysId
	 * @return
	 */
	public Site2Category findSite2CategoryBy(long siteSysId, Integer relationId, long categorySysId);

	public Site2Category findSite2CategoryBy(String siteId, Integer relationId, String categoryId);

	public Site2Site findSite2SiteBy(String homeUrl, Integer relationId, String homeUrl2);

	public Site2Site findSite2SiteBy(long site2SiteSysId);

	public Site2Content findSite2ContentBy(long site2ContentSysId);

	public Site2Content findSite2ContentBy(String siteId, Integer relationId, String contentId);

	public Site2Content findSite2ContentBy(long siteSysId, Integer relationId, long contentSysId);

	/**
	 * find site is member of the leaf category
	 * 
	 * @param siteSysId
	 * @param relationId
	 * @return
	 */
	public Site2Category findSiteLeafCategoryBy(long siteSysId, Integer relationId);

	/**
	 * 
	 * @param sysId
	 * @param longUserSysId
	 *            -1:no webSiteFriendRequests
	 * @return HashMap contains:- webSite,contactAddress,contactIMNumbers(list
	 *         of contactIMNumber),webSiteUserRequests,webSiteFriendRequests
	 */
	// public Map getWebSiteDetailBy(long sysId, long loginUserSysId);
	// public Map getStoreDetailBy(long sysId, long loginUserSysId);
	public Site findSiteBySysId(long sysId);

	public Site findSiteBySiteId(String siteId);

	public List<Site2Category> getListSite2CategoryBy(long webSiteSysId, Integer[] relationIds, long categorySysId,
			Integer[] statusIds, Integer[] siteTypeIds, int pgno, int pgsize, String orderBy);

	public long getCountSite2CategoryBy(long webSiteSysId, Integer[] relationIds, long categorySysId,
			Integer[] statusIds, Integer[] siteTypeIds);

	/**
	 * 
	 * @param siteId
	 * @param relationIds
	 * @param categoryId
	 * @param bizCategoryId
	 * @param statusIds
	 * @param siteTypeIds
	 * @param pageno
	 * @param pagesize
	 * @param orderBy
	 * @return
	 */
	public List<Site2Category> getListSite2CategoryBy(String siteId, Integer[] relationIds, String categoryId,
			String bizCategoryId, Integer[] statusIds, Integer[] siteTypeIds, int pageno, int pagesize, String orderBy);

	public long getCountSite2CategoryBy(String siteId, Integer[] relationIds, String categoryId, String bizCategoryId,
			Integer[] statusIds, Integer[] siteTypeIds);

	/**
	 * 
	 * @param siteSysId
	 * @param relationIds
	 * @param site2SysId
	 * @param statusIds
	 * @param pgno
	 * @param pgsize
	 * @param orderBy
	 * @return
	 */
	public List<Site2Site> getListSite2SiteBy(long siteSysId, Integer[] relationIds, long site2SysId,
			Integer[] statusIds, int pgno, int pgsize, String orderBy);

	/**
	 * 
	 * @param siteSysId
	 * @param relationIds
	 * @param site2SysId
	 * @param statusIds
	 * @return
	 */
	public long getCountSite2SiteBy(long siteSysId, Integer[] relationIds, long site2SysId, Integer[] statusIds);

	/**
	 * get list of site 2 coupon by parameters
	 * 
	 * @param siteSysId
	 * @param relationIds
	 * @param contentSysId
	 * @param statusIds
	 * @param contentTypeIds
	 * @param site2SiteCategoryRelationIds
	 * @param siteCategoryId
	 * @param pgno
	 * @param pgsize
	 * @param orderBy
	 * @return
	 */
	public List<Site2Content> getListSite2ContentBy(long siteSysId, Integer[] relationIds, long contentSysId,
			Integer[] statusIds, Integer[] contentTypeIds, Integer[] site2SiteCategoryRelationIds,
			String siteCategoryId, int pgno, int pgsize, String orderBy);

	/**
	 * get count of site 2 coupon by parameters
	 * 
	 * @param siteSysId
	 * @param relationIds
	 * @param contentSysId
	 * @param statusIds
	 * @param contentTypeIds
	 * @param site2SiteCategoryRelationIds
	 * @param siteCategoryId
	 * @return
	 */
	public long getCountSite2ContentBy(long siteSysId, Integer[] relationIds, long contentSysId, Integer[] statusIds,
			Integer[] contentTypeIds, Integer[] site2SiteCategoryRelationIds, String siteCategoryId);

	/**
	 * get list of site2content
	 * 
	 * @param siteId
	 * @param relationIds
	 * @param contentId
	 * @param statusIds
	 * @param contentTypeIds
	 * @param pgno
	 * @param pgsize
	 * @param orderBy
	 * @return
	 */
	public List<Site2Content> getListSite2ContentBy(String siteId, Integer[] relationIds, String contentId,
			Integer[] statusIds, Integer[] contentTypeIds, int pgno, int pgsize, String orderBy);

	/**
	 * get count of site2content
	 * 
	 * @param siteId
	 * @param relationIds
	 * @param contentId
	 * @param statusIds
	 * @param contentTypeIds
	 * @return
	 */
	public long getCountSite2ContentBy(String siteId, Integer[] relationIds, String contentId, Integer[] statusIds,
			Integer[] contentTypeIds);

	/**
	 * get all sites by
	 * 
	 * @param siteTypeIds
	 * @param beforeLastUpdatedDate
	 * @param pgno
	 * @param pgsize
	 * @param orderBy
	 * @return list of site
	 */
	public List<Site> getListSiteBy(Integer[] siteTypeIds, Date beforeLastUpdatedDate, int pgno, int pgsize,
			String orderBy);

	/**
	 * get count of site
	 * 
	 * @param siteTypeIds
	 * @param beforeDate
	 * @return
	 */
	public long getCountSiteBy(Integer[] siteTypeIds, Date beforeDate);

	/**
	 * clean site 2content
	 * 
	 * @param siteSysId
	 * @param relationIds
	 * @param contentSysId
	 * @param statusId
	 */
	public void updateSite2ContentStatus(long siteSysId, Integer[] relationIds, long contentSysId, Integer statusId);
}
